package com.neudu.glsb.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 员工请假信息
 * @TableName employee_leave
 */
@TableName(value ="employee_leave")
@Data
public class EmployeeLeave implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 员工 ID
     */
    private Integer employeeId;

    /**
     * 请假开始日期
     */
    private Date startDate;

    /**
     * 请假结束日期
     */
    private Date endDate;

    /**
     * 请假原因
     */
    private String reason;

    /**
     * 请假状态：待审批、已通过、未通过
     */
    private String status;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @TableField(exist = false)
    private String employeeName;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        EmployeeLeave other = (EmployeeLeave) that;
        return (this.getId() == null? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getEmployeeId() == null? other.getEmployeeId() == null : this.getEmployeeId().equals(other.getEmployeeId()))
                && (this.getStartDate() == null? other.getStartDate() == null : this.getStartDate().equals(other.getStartDate()))
                && (this.getEndDate() == null? other.getEndDate() == null : this.getEndDate().equals(other.getEndDate()))
                && (this.getReason() == null? other.getReason() == null : this.getReason().equals(other.getReason()))
                && (this.getStatus() == null? other.getStatus() == null : this.getStatus().equals(other.getStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null)? 0 : getId().hashCode());
        result = prime * result + ((getEmployeeId() == null)? 0 : getEmployeeId().hashCode());
        result = prime * result + ((getStartDate() == null)? 0 : getStartDate().hashCode());
        result = prime * result + ((getEndDate() == null)? 0 : getEndDate().hashCode());
        result = prime * result + ((getReason() == null)? 0 : getReason().hashCode());
        result = prime * result + ((getStatus() == null)? 0 : getStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", employeeId=").append(employeeId);
        sb.append(", startDate=").append(startDate);
        sb.append(", endDate=").append(endDate);
        sb.append(", reason=").append(reason);
        sb.append(", status=").append(status);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}